home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / NeoIntroTCL3.0 folder / TCL / NeoDemo / Source / CNDPicture.cp < prev    next >
Encoding:
Text File  |  1995-01-03  |  1.7 KB  |  77 lines  |  [TEXT/KAHL]

  1. /****
  2.  * CNDPicture.c
  3.  *
  4.  *  Copyright © 1992 NeoLogic Systems.  All rights reserved.
  5.  *
  6.  ****/
  7.  
  8. #include "NeoTypes.h"
  9. #include "CNDPicture.h"
  10. #include "CNeoDemoDoc.h"
  11. #include "CNeoDLOGDialog.h"
  12. #include "CNeoDialogText.h"
  13.  
  14. /* PICT IDs in dialog for signaling show/hide lower items */
  15. #define kUpSigID   131
  16. #define kSideSigID 130
  17. #define kDownSigID 129
  18.  
  19. void CNDPicture::INDPicture(short aID, CView *anEnclosure, CBureaucrat *aSupervisor, short aWidth, short aHeight,
  20.     short aHEncl, short aVEncl, SizingOption aHSizing, SizingOption aVSizing)
  21. {
  22.     IPicture(anEnclosure, aSupervisor, aWidth, aHeight, aHEncl, aVEncl, aHSizing, aVSizing);
  23.  
  24.     UsePICT(aID);
  25.     fState = FALSE;
  26. }
  27.  
  28. void CNDPicture::DoClick(Point hitPt, short modifierKeys, long when)
  29. {
  30.     Rect tempRect;
  31.     long ticks;
  32.  
  33.     SetOrigin((short)hOrigin, (short)vOrigin);
  34.     LongToQDRect(&aperture, &tempRect);
  35.     UsePICT(kSideSigID);
  36.     EraseRect(&tempRect);
  37.     Draw(&tempRect);                                /* show intermediate PICT */
  38.     Delay(15, &ticks);
  39.     EraseRect(&tempRect);
  40.     RestoreEnvironment();
  41.  
  42.     Zoom(!fState);
  43. }
  44.  
  45. Boolean CNDPicture::isZoomed(void)
  46. {
  47.     return fState;
  48. }
  49.  
  50. void CNDPicture::Zoom(Boolean aOut)
  51. {
  52.     short            id;
  53.     short            width;
  54.     short            height;
  55.     CNeoDemoDoc *    document;
  56.  
  57.     if (fState != aOut) {
  58.         width = macPort->portRect.right - macPort->portRect.left;
  59.         document = ((CNeoDemoDoc *)((CNeoDLOGDialog *)itsSupervisor)->itsSupervisor);
  60.  
  61.         if (aOut) {
  62.             height = document->fBottomLine;
  63.             id = kDownSigID;
  64.             document->fSearchText->Show();             /* so tab includes this field */
  65.         }
  66.         else {
  67.             height = document->fDivideLine -2;
  68.             id = kUpSigID;
  69.             document->fSearchText->Hide();             /* so tab skips this field */
  70.         }
  71.  
  72.         ((CNeoDLOGDialog *)itsSupervisor)->ChangeSize(width, height);
  73.         UsePICT(id);
  74.         fState = aOut;
  75.         Refresh();
  76.     }
  77. }